Page({
      /**
       * 页面的初始数据
       */
      data: {
        searchContent:'',  //搜索内容，按名字一致
         euse: [
           { name: '食用(淀粉)', img: "../../images/edible.png", url: "fenlei/edible/edible" },
           { name: '药用植物', img: "../../images/medicinal.png", url: "fenlei/medicinal/medicinal" },
           { name: '有毒植物', img: "../../images/poisonous.png", url: "fenlei/poisonous/poisonous" },
           { name: '牧草/蜜源', img: "../../images/fodder.png", url: "fenlei/fodder/fodder" },
           { name: '纤维植物', img: "../../images/fiber.png", url: "fenlei/fiber/fiber" },
           { name: '用材树木', img: "../../images/timber.png", url: "fenlei/timber/timber" },
           { name: '绿化观赏', img: "../../images/green.png", url: "fenlei/green/green" },
           { name: '油脂', img: "../../images/grease.png", url: "fenlei/grease/grease" }
        ],
        indexes:[
          { name: '科', img: "../../images/ke.png", url:"fenlei/firstke/firstke?id=43"},
          // { name: '属', img: "../../images/shu.png", url: "fenlei/firstke/firstshu" },
        ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {
    var that=this;
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  },
  //输入信息
  searchInput: function (e) {
    console.log(e.detail.value);
    this.setData({ searchContent: e.detail.value });
  },
  //搜索按钮
  searchButton: function () {
    var searchKey = this.data.searchContent;
    if(searchKey.length==0);
    else{
      var plantSearchUrl = getApp().globalData.plantSearch + searchKey;
      console.log(plantSearchUrl);
      wx.request({
        url: plantSearchUrl,
        success: function (res) {
          var returnData = res.data;
          console.log(returnData);
          wx.navigateTo({
            url: "../searchinfo/searchinfo"
          }),
            wx.setStorageSync('returnData', returnData);
          return;
        }
      })
    }
  },

})